<!DOCTYPE html>
<html>
<head>
	<title>数组排序</title>
	<meta charset="utf-8">
</head>
<body>
	<script type="text/javascript">
		var nums = [1,4,2,5,7,3];
		console.log(nums);

		nums.sort(function (a,b) {
			return a-b;
		});

		console.log(nums);


	</script>
</body>
</html>